One known technique to store and manage the latest data involves the use of a ring buffer. The ring buffer in general has a problem in that, when data buffered therein each have a different or variable length, the start position of the oldest or nearly oldest data cannot be specified.
In the case of variable-length data, the start position of each data depends on the previous data and therefore is unfixed, which makes it difficult to specify the start position of the oldest data or the like. In order to solve the problem, the ring buffer may retain information indicating the start position of the oldest data and update the information each time existing data are overwritten. This, however, causes an increase in the amount of processing to write data.
With the ring buffer, another problem arises if there exists a plurality of time-series data generators.
Two types of approaches have been made to the problem of a plurality of time-series data generators to apply the ring buffer technique.
The first approach is to share one ring buffer among a plurality of data generators. In this case, before a data generator writes data to the ring buffer, the generator is required to perform exclusive access control concerning the use of the buffer with the other data generators.
The exclusive access control introduces overhead to each data write operation, thus causing an increase in the amount of processing to write data to the buffer. In other words, the write performance of the buffer is deteriorated.
The second approach is to allocate a ring buffer to each data generator. In this case, exclusive access control is not necessary differently from the first approach. However, the buffer cannot be efficiently utilized. More specifically, if the amounts of data produced per unit of time by respective data generators are considerably different, the time length during which time-series data stored in the buffer is valid is determined by the period until the buffer of a generator which produces data most frequently becomes full. Accordingly, the buffer of a generator which produces data less frequently is not efficiently utilized.
It is assumed that ring buffers (buffers 1 and 2) each having a capacity of 1 are allocated to generators 1 and 2, respectively, and the generator 1 produces data in an amount of 1 per unit of time, while the generator 2 produces data in an amount of 0.1. In this case, the buffers 1 and 2 can store time-series data having time lengths of 1 and 10, respectively. However, considering the buffers (both the buffers 1 and 2) as a whole, the time length of time-series data capable of being buffered is set to the shortest one of the time lengths of data stored in the respective buffers. That is, the time length of time-series data is set to 1 corresponding to the buffer 1. Otherwise, data produced during a certain period of time may no longer exist in the buffer 1, and therefore, it becomes impossible to satisfy the condition that “data produced by respective generators should be read out from buffers in order of data creation time”. Consequently, the area in the buffer 2 for storing data produced during a period from (current time −10) to (current time −1) is not efficiently utilized. Generally, the frequency of data creation by each generator cannot be estimated and also may vary according to circumstances. It is, therefore, impossible to allocate each generator a buffer having a capacity most suitable for the generator in advance. Thus, allocation cannot be performed successfully in terms of efficiency as well as buffer capacity. That is, the second approach has a problem in that data produced by respective generators cannot be read out from buffers in order of data creation time (time series order).
In Japanese Patent Application laid open No. HEI6-266855, there is described a time-series data file system, and FIG. 3 thereof shows an example of the constructions of a file area and file management information. In the file area, the data record and free record lengths are fixed.
In the time-series data file system, however, when one buffer is written by a plurality of data generators, adjustment or access control is required with respect to the use of the buffer among the data generators.
In Japanese Patent Application laid open No. HEI11-73367, there is described a storage control device, and FIG. 1 thereof shows the first and second pointers in a management information storage. The first pointer specifies the start address of an area in a data storage in which subsequent data is to be stored. The second pointer specifies the start address of an area in the data storage in which the oldest valid data are stored. These pointers differ from those of the present invention.
In Japanese Patent No. 3365372, there is disclosed an event log information storing system. In the event log information storing system, a ring buffer is formed for a plurality of data generators, and if there is no available buffer, one of used buffers is selected according to an algorithm for reuse.
In the conventional techniques for managing time-series data, when a plurality of time-series data generators exists, there are problems of overhead due to exclusive access control and efficient use of a buffer.
Further, in the case of variable-length data, it is difficult to specify the start position of the oldest data or the like.